﻿using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using NiuX.LightServer.Handlers;
using NiuX.LightServer.Options;

namespace NiuX.LightServer
{
    public interface IServer
    {
        IServer SetIP(string ip);

        IServer SetPort(int port);

        IWebHost Host { get; }

        IServer AddHandler(HttpHandler handler);

        IServer EnableCors(CorsOptions option);

        IServer SetLinstenUrls(params string[] url);

        Task RunAsync();

        Task Stop();
    }
}